import type {
  ${className}AddDTOType,
  ${className}UpdateDTOType,
  ${className}SearchDTOType,
  ${className}SearchVOType,
} from '@/types/${packName}/${className}Type'
import type { TableColumn } from '@/types/base/table'
import { FormComponentType, type FormItemConfig } from '@/types/base/form'

/**
* ${tableComment} 参数对象
*/
export class ${className}Param {
  /**
   * 表单参数
   */
  static formColumn: FormItemConfig[] = [
<#if columns??>
  <#list columns as column>
    <#if !column.keyFlag>
      <#if !column.isParent>
      {
        label: '${column.columnComment}',
        prop: '${column.fieldName}',
        type: FormComponentType.INPUT,
        field: '${column.fieldName}'
      }<#if column_has_next>,</#if>
      </#if>
    </#if>
  </#list>
</#if>
  ]
  /**
   * 表格参数
   */
  static tableColumn: TableColumn[] = [
<#if columns??>
  <#list columns as column>
    <#if !column.keyFlag>
    {
      label: '${column.columnComment}',
      field: '${column.fieldName}'
    },
    </#if>
  </#list>
</#if>
    {
      label: '操作',
      field: 'right',
      attribute: {
        fixed: 'right',
        width: '200px'
      },
      template: {
        options: [
          {
            icon: 'edit',
            type: 'primary',
            size: 'small',
            method: 'update'
          },
          {
            icon: 'delete',
            type: 'danger',
            size: 'small',
            method: 'remove'
          }
        ]
      }
    }
  ]
  /**
   * 添加对象
   */
  static addDTO: ${className}AddDTOType = {
<#if columns??>
  <#list columns as column>
    <#if !column.keyFlag>
      <#if !column.isParent>
      ${column.fieldName}: ${column.frontDefault}<#if column_has_next>,</#if>
      </#if>
    </#if>
  </#list>
</#if>
  }
  /**
   * 修改对象
   */
  static updateDTO: ${className}UpdateDTOType = {
<#if columns??>
  <#list columns as column>
    <#if !column.isParent>
    ${column.fieldName}: ${column.frontDefault}<#if column_has_next>,</#if>
    </#if>
  </#list>
</#if>
  }
  /**
   * 查询对象
   */
  static searchDTO: ${className}SearchDTOType = {
<#if columns??>
<#-- 使用 ?filter 过滤掉 searchInfo 为 null 的 column -->
  <#assign validColumns = columns?filter(column -> column.searchInfo??)>
  <#list validColumns as column>
    ${column.fieldName!}: ${column.frontDefault!""},  <#-- 每个字段后都加逗号 -->
  </#list>
</#if>
    page: {
      current: 1,
      size: 20
    }
  }

 /**
  * 查询返回对象
  */
  static searchVO: ${className}SearchVOType = {
<#if columns??>
  <#list columns as column>
    ${column.fieldName!}: ${column.frontDefault!""},  <#-- 每个字段后都加逗号 -->
  </#list>
</#if>
  }
}